﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="gongying_edit.aspx.cs" Inherits="DTcms.Web.admin.gongqiu.gongying_edit" ValidateRequest="false" %>
<%@ Import namespace="DTcms.Common" %>

<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>编辑产品供应</title>
    <meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,initial-scale=1.0,user-scalable=no" />
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <link rel="stylesheet" type="text/css" href="../../scripts/artdialog/ui-dialog.css" />
    <link rel="stylesheet" type="text/css" href="../skin/icon/iconfont.css" />
    <link rel="stylesheet" type="text/css" href="../skin/default/style.css" />
    <script type="text/javascript" charset="utf-8" src="../../scripts/jquery/jquery-1.11.2.min.js"></script>
    <script type="text/javascript" charset="utf-8" src="../../scripts/jquery/Validform_v5.3.2_min.js"></script>
    <script type="text/javascript" charset="utf-8" src="../../scripts/datepicker/WdatePicker.js"></script>
    <script type="text/javascript" charset="utf-8" src="../../scripts/artdialog/dialog-plus-min.js"></script>
    <script type="text/javascript" charset="utf-8" src="../../scripts/webuploader/webuploader.min.js"></script>
    <script type="text/javascript" charset="utf-8" src="../../editor/ueditor.config.js"></script>
    <script type="text/javascript" charset="utf-8" src="../../editor/ueditor.all.min.js"> </script>
    <script type="text/javascript" charset="utf-8" src="../../editor/lang/zh-cn/zh-cn.js"></script>
    <script type="text/javascript" charset="utf-8" src="../js/uploader.js"></script>
    <script type="text/javascript" charset="utf-8" src="../js/common.js"></script>
    <script type="text/javascript" charset="utf-8" src="../js/laymain.js"></script>
    <script type="text/javascript">
        $(function () {
            //初始化表单验证
            $("#form1").initValidform();
            //初始化上传控件
            $(".upload-img").InitUploader({ sendurl: "../../tools/upload_ajax.ashx", swf: "../../scripts/webuploader/uploader.swf", thumbnail: true });
            //初始化编辑器
            var ue = UE.getEditor('txtContent', {
                serverUrl: '../../../tools/upload_ajax.ashx',
                toolbars: [[
                    'fullscreen', 'source', '|', 'undo', 'redo', '|',
                    'bold', 'italic', 'underline', 'removeformat', 'pasteplain', '|', 'forecolor', 'fontsize', 'insertorderedlist', 'insertunorderedlist', '|',
                    'justifyleft', 'justifycenter', 'justifyright', 'justifyjustify', '|',
                    'link', 'unlink', '|',
                    'simpleupload', 'insertimage', 'scrawl', 'insertvideo', 'attachment'
                ]]
            });
            $(".upload-album").InitUploader({ btntext: "批量上传", multiple: true, water: true, thumbnail: true, filesize: "<%=sysConfig.imgsize %>", sendurl: "../../tools/upload_ajax.ashx", swf: "../../scripts/webuploader/uploader.swf" });

            //设置封面图片的样式
            $(".photo-list ul li .img-box img").each(function () {
                if ($(this).attr("src") == $("#hidFocusPhoto").val()) {
                    $(this).parent().addClass("selected");
                }
            });
        });
        //修改关联客户
        function EditUser() {
            var d = top.dialog({
                title: '修改关联会员',
                url: 'dialog/dialog_user.aspx',
                width: 750,
                height: 450,
                data: window //传入当前窗口
            }).showModal();
            d.lb_username = $("#lbUserName");
            d.userid = $("#txtUserID");
            d.lianxiren = $("#txtLianxiren");
            d.mobile = $("#txtMobile");
        }
        function ShowUsersAdd() {
            var _mobile = $("#txtMobile").val();
            if (_mobile != "") {
                //window.open("../users/user_edit_fast.aspx?mobile=" + _mobile, "top");
                window.open("../company/company_edit.aspx?mobile=" + _mobile, "top");
            }
            //alert(_mobile);
        }
        //修改关联圈子
        function EditQuanzi() {
            var d = top.dialog({
                title: '修改关联石材圈',
                url: 'dialog/dialog_quanzi.aspx',
                width: 750,
                height: 450,
                data: window //传入当前窗口
            }).showModal();
            d.lb_quanziname = $("#lbQuanziName");
            d.quanziid = $("#txtQuanziID");
        }
    </script>
</head>

<body class="mainbody">
    <form id="form1" runat="server">
        <!--导航栏-->
        <div class="location">
            <a href="gongying_list.aspx" class="back"><i class="iconfont icon-up"></i><span>返回列表页</span></a>
            <a href="../center.aspx"><i class="iconfont icon-home"></i><span>首页</span></a>
            <i class="arrow iconfont icon-arrow-right"></i>
            <a href="photo_list.aspx"><span>产品供应管理</span></a>
            <i class="arrow iconfont icon-arrow-right"></i>
            <span>编辑产品供应</span>
        </div>
        <div class="line10"></div>
        <!--/导航栏-->

        <!--内容-->
        <div id="floatHead" class="content-tab-wrap">
            <div class="content-tab">
                <div class="content-tab-ul-wrap">
                    <ul>
                        <li><a class="selected" href="javascript:;">基本信息</a></li>
                    </ul>
                </div>
            </div>
        </div>

        <div class="tab-content">
            <dl>
                <dt>显示状态</dt>
                <dd>
                    <div class="rule-multi-radio">
                        <asp:RadioButtonList ID="rblStatus" runat="server" RepeatDirection="Horizontal" RepeatLayout="Flow">
                            <asp:ListItem Value="1" Selected="True">显示</asp:ListItem>
                            <asp:ListItem Value="2">关闭</asp:ListItem>
                        </asp:RadioButtonList>
                    </div>
                </dd>
            </dl>
            <dl>
                <dt>石材名称</dt>
                <dd>
                    <asp:TextBox ID="txtTitle" runat="server" CssClass="input normal" datatype="*1-100" sucmsg=" "></asp:TextBox>
                    <span class="Validform_checktip">*中文名称，100字符内</span></dd>
            </dl>
            <dl>
                <dt>所属类别</dt>
                <dd>
                    <div class="rule-single-select" style="z-index:200">
                        <asp:DropDownList ID="ddlCategoryId" runat="server" datatype="*" sucmsg=" "></asp:DropDownList>
                    </div>
                </dd>
            </dl>
            <dl>
                <dt>显示图片</dt>
                <dd>
                    <asp:TextBox ID="txtImgUrl" runat="server" CssClass="input normal upload-path" />
                    <div class="upload-box upload-img"></div>
                </dd>
            </dl>
            <dl>
                <dt>价格</dt>
                <dd>
                    <asp:TextBox ID="txtPrice" runat="server" CssClass="input small" datatype="n" sucmsg=" ">0</asp:TextBox> 元
                    / 
                    <div class="rule-single-select">
                        <asp:DropDownList ID="ddlUnit" runat="server">
                            <asp:ListItem>平方</asp:ListItem>
                            <asp:ListItem>立方</asp:ListItem>
                            <asp:ListItem>米</asp:ListItem>
                            <asp:ListItem>个</asp:ListItem>
                            <asp:ListItem>块</asp:ListItem>
                        </asp:DropDownList>
                    </div>
                </dd>
            </dl>
            <dl>
                <dt>尺寸</dt>
                <dd>
                    <asp:TextBox ID="txtLong" runat="server" CssClass="input small" datatype="n" sucmsg=" "></asp:TextBox>
                    ×
                    <asp:TextBox ID="txtWide" runat="server" CssClass="input small" datatype="n" sucmsg=" "></asp:TextBox>
                    ×
                    <asp:TextBox ID="txtHeight" runat="server" CssClass="input small" datatype="n" sucmsg=" "></asp:TextBox>
                    长 × 宽 × 高 (mm)
                </dd>
            </dl>
            <dl>
                <dt>详细介绍</dt>
                <dd>
                    <textarea id="txtContent" class="editor" runat="server" style="width: 100%; height: 280px;"></textarea>
                </dd>
            </dl>
              <dl>
    <dt>发布时间</dt>
    <dd>
      <asp:TextBox ID="txtAddTime" runat="server" CssClass="input rule-date-input" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" datatype="/^\s*$|^\d{4}\-\d{1,2}\-\d{1,2}\s{1}(\d{1,2}:){2}\d{1,2}$/" errormsg="请选择正确的日期" sucmsg=" " />
      <span class="Validform_checktip">不选择默认当前发布时间</span>
    </dd>
  </dl>
            <dl>
                <dt>关联会员</dt>
                <dd>
                    <asp:Label ID="lbUserName" runat="server" Text=""></asp:Label>
                    <asp:TextBox ID="txtUserID" runat="server" Text="0" Style="display:none"></asp:TextBox>
                    <a class="icon-btn" onclick="EditUser()"><i class="iconfont icon-edit"></i><span>设置关联会员</span></a>
                </dd>
            </dl>
              <dl>
                <dt>关联石材圈</dt>
                <dd>
                    <asp:Label ID="lbQuanziName" runat="server" Text=""></asp:Label>
                    <asp:TextBox ID="txtQuanziID" runat="server" Text="0" Style="display: none"></asp:TextBox>
                    <a class="icon-btn" onclick="EditQuanzi()"><i class="iconfont icon-edit"></i><span>设置关联石材圈</span></a>
                </dd>
            </dl>
            <dl>
                <dt>联系人</dt>
                <dd>
                    <asp:TextBox ID="txtLianxiren" runat="server" CssClass="input normal" />
                </dd>
            </dl>
            <dl>
                <dt>手机号</dt>
                <dd>
                    <asp:TextBox ID="txtMobile" runat="server" CssClass="input normal" datatype="n" sucmsg=" " ajaxurl="../../tools/admin_ajax.ashx?action=mobile_validate" /> 
                    <span class="Validform_checktip">*11位手机号码</span>
                    <a href="javascript:void(0)" class="btn-tools" onclick="ShowUsersAdd()">添加新会员</a>
                </dd>
            </dl>
           <dl>
    <dt>图片相册</dt>
    <dd>
      <div class="upload-box upload-album"></div>
      <input type="hidden" name="hidFocusPhoto" id="hidFocusPhoto" runat="server" class="focus-photo" />
      <div class="photo-list">
        <ul>
          <asp:Repeater ID="rptAlbumList" runat="server">
          <ItemTemplate>
            <li>
              <input type="hidden" name="hid_photo_name" value="<%#Eval("id")%>|<%#Eval("original_path")%>|<%#Eval("thumb_path")%>" />
              <input type="hidden" name="hid_photo_remark" value="<%#Eval("remark")%>" />
              <div class="img-box" onclick="setFocusImg(this);">
                <img src="<%#Eval("thumb_path")%>" bigsrc="<%#Eval("original_path")%>" />
                <span class="remark"><i><%#Eval("remark").ToString() == "" ? "暂无描述..." : Eval("remark").ToString()%></i></span>
              </div>
              <a href="javascript:;" onclick="setRemark(this);">描述</a>
              <a href="javascript:;" onclick="delImg(this);">删除</a>
            </li>
            </ItemTemplate>
          </asp:Repeater>
        </ul>
      </div>
    </dd>
  </dl>
        <!--/内容-->

        <!--工具栏-->
        <div class="page-footer">
            <div class="btn-wrap">
                <asp:Button ID="btnSubmit" runat="server" Text="提交保存" CssClass="btn" OnClick="btnSubmit_Click" />
                <input name="btnReturn" type="button" value="返回上一页" class="btn yellow" onclick="javascript: history.back(-1);" />
            </div>
        </div>
        <!--/工具栏-->
    </form>
</body>
</html>
